//package org.csc.gateway.config;
//
//import org.csc.gateway.filter.LimitFilter;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.cloud.gateway.route.RouteLocator;
//import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
//import org.springframework.context.annotation.Bean;
//
//import java.time.Duration;
//
////@Configuration
//public class CurrentLimitingConfig {
//
//
//    @Bean
//    public RouteLocator customerRouteLocator(RouteLocatorBuilder builder) {
//        return builder.routes()
////                .route(r -> r.path("/api-service/**")
////                        .filters(f -> f.stripPrefix(1))
////                        .uri("lb://api-service")
////                        .id("api-service")
////                )
////                .route(r -> r.path("/api-service/**")
////                        .filters(f -> f.stripPrefix(1)
////                                .filter(rateLimitByCpuGatewayFilter))
////                        .uri("lb://api-service")
////                        .order(0)
////                        .id("api-service")
////                )
//                .route(r -> r.path("/api-service/**")
//                        .filters(f -> f.stripPrefix(1)
//                                .filter(new LimitFilter(10, 1, Duration.ofSeconds(10))))
//                        .uri("lb://api-service")
//                        .order(0)
//                        .id("api-service")
//                )
//                .build();
//    }
//
//
//}
